package com.itheima.test02;

import java.util.Scanner;

public class demo03 {

    // 正则表达式
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入邮箱地址：");
        String str = sc.nextLine();
        check_emial(str);
    }

    public static void check_emial(String str){
        if(str.matches("\\w{1,}@[a-z0-9]{1,10}(\\.[a-z]{2,3}){1,2}")){
            System.out.println("合法");
        }else{
            System.out.println("非法");
        }
    }
}
